#include <iostream>
#include <cmath>
using namespace std;
int gcd(int a, int b){
        while (b != 0) {
        int tmp = a;
        a = b;
        b = tmp % b;
                       }
	return a;
}
int main(){
        int a, b;
        cout<<"Please input two number(separated with space):";
        cin>>a>>b;
	int c=gcd(a,b);
	cout<<c<<",";
	cout<<a*b/c<<endl;
}
